Skip to content

Fix debuginfo argument when invoking LLBC linker#159211

Open
kulst wants to merge 1 commit into
rust-lang:mainfrom
kulst:llbc-fix-debuginfo
Open

Fix debuginfo argument when invoking LLBC linker#159211
kulst wants to merge 1 commit into
rust-lang:mainfrom
kulst:llbc-fix-debuginfo

Conversation

@kulst

@kulst kulst commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Previously LLBC's Linker implementation unconditionally added --debug to the linker invocation. This just became visible when 062ecd6 made LLBC no longer strip debug information unconditionally.

It is also common to use cargo build --release together with -Zbuild-std=core when targeting NVPTX. In this case the release profile will prevent all crates from embedding debug information in the first place. This additionally made the bug less visible.

This PR adds the proper logic to LLBC's linker implementation to only invoke LLBC with --debug when debug-information should not be stripped.

I did not add a regression test yet, since this would require to actually invoke the linker in assembly-llvm. As soon as #157512 is merged and we have assembly-output: linker-asm available, I want to follow up on that.

cc: @kjetilkjeka
@rustbot label +O-NVPTX

Previously LLBC's Linker implementation unconditionally added `--debug`
to the linker invocation. This just became visible when 062ecd6
made LLBC no longer strip debug information unconditionally.

Add the proper logic to LLBC's linker implementation to only invoke
LLBC with `--debug` when debug-information should not be stripped.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 13, 2026
@rustbot

rustbot commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

r? @mu001999

rustbot has assigned @mu001999.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: codegen, compiler
  • codegen, compiler expanded to 75 candidates
  • Random selection from 18 candidates

@mu001999

Copy link
Copy Markdown
Member

Makes sense to me, but I'm not familiar with LLBC, so @rustbot reroll

@rustbot rustbot assigned tiif and unassigned mu001999 Jul 13, 2026
@rustbot rustbot added the O-NVPTX Target: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-NVPTX Target: the NVPTX LLVM backend for running rust on GPUs, https://llvm.org/docs/NVPTXUsage.html S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants